﻿using SinavSistemi.Class;
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace SinavSistemi
{
    public partial class sinavlar : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            try
            {
                SqlConnection sqlcon = connection.baglanti;
                SqlCommand sqlcmd = new SqlCommand("insert into sinavlar (sinavismi,sorusayisi) values (@sinavismi,@sorusayisi)", sqlcon);
                sqlcmd.Parameters.AddWithValue("@sinavismi",txtBaslık.Text);
                sqlcmd.Parameters.AddWithValue("@sorusayisi",txtSorusay.Text);
                sqlcon.Open();

                sqlcmd.ExecuteNonQuery();
                sqlcon.Close();

                Response.Write("Başarili");

            }
            catch (Exception)
            {
                
                throw;
            }
        }
    }
}